feat(clerk-js): Introduce UNSAFE_PortalProvider#7310
Conversation
🦋 Changeset detectedLatest commit: aee4553 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughIntroduces a portal provider system: adds 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
!snapshot |
|
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. |
|
!snapshot |
|
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. |
|
!snapshot |
|
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/agent-toolkit@0.2.6-snapshot.v20251125180024 --save-exact
npm i @clerk/astro@2.16.4-snapshot.v20251125180024 --save-exact
npm i @clerk/backend@2.24.1-snapshot.v20251125180024 --save-exact
npm i @clerk/chrome-extension@2.8.7-snapshot.v20251125180024 --save-exact
npm i @clerk/clerk-js@5.111.1-snapshot.v20251125180024 --save-exact
npm i @clerk/elements@0.23.87-snapshot.v20251125180024 --save-exact
npm i @clerk/clerk-expo@2.19.7-snapshot.v20251125180024 --save-exact
npm i @clerk/expo-passkeys@0.4.23-snapshot.v20251125180024 --save-exact
npm i @clerk/express@1.7.54-snapshot.v20251125180024 --save-exact
npm i @clerk/fastify@2.6.6-snapshot.v20251125180024 --save-exact
npm i @clerk/localizations@3.28.6-snapshot.v20251125180024 --save-exact
npm i @clerk/nextjs@6.35.6-snapshot.v20251125180024 --save-exact
npm i @clerk/nuxt@1.13.4-snapshot.v20251125180024 --save-exact
npm i @clerk/clerk-react@5.57.1-snapshot.v20251125180024 --save-exact
npm i @clerk/react-router@2.3.1-snapshot.v20251125180024 --save-exact
npm i @clerk/remix@4.13.21-snapshot.v20251125180024 --save-exact
npm i @clerk/shared@3.36.1-snapshot.v20251125180024 --save-exact
npm i @clerk/tanstack-react-start@0.27.6-snapshot.v20251125180024 --save-exact
npm i @clerk/testing@1.13.20-snapshot.v20251125180024 --save-exact
npm i @clerk/themes@2.4.41-snapshot.v20251125180024 --save-exact
npm i @clerk/types@4.101.4-snapshot.v20251125180024 --save-exact
npm i @clerk/vue@1.17.1-snapshot.v20251125180024 --save-exact |
…vascript into alexcarpenter/portal-provider-3
|
Hey @alexcarpenter - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/agent-toolkit@0.2.9-snapshot.v20260109194807 --save-exact
npm i @clerk/astro@3.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/backend@3.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/chrome-extension@3.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/clerk-js@6.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/dev-cli@1.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/expo@3.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/expo-passkeys@1.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/express@2.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/fastify@2.6.9-snapshot.v20260109194807 --save-exact
npm i @clerk/localizations@4.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/msw@0.0.1-snapshot.v20260109194807 --save-exact
npm i @clerk/nextjs@7.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/nuxt@2.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/react@6.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/react-router@3.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/shared@4.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/tanstack-react-start@1.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/testing@2.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/ui@1.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/upgrade@2.0.0-snapshot.v20260109194807 --save-exact
npm i @clerk/vue@2.0.0-snapshot.v20260109194807 --save-exact |
wobsoriano
left a comment
There was a problem hiding this comment.
Looks good! Test it locally with the React and Vue SDKs:
- React using shadcn + Dialog component
React_Unsafe_PortalProvider.mov
- Vue using shadcn-vue + Dialog component
Vue_Unsafe_PortalProvider.mov
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In
`@packages/ui/src/components/OrganizationSwitcher/__tests__/OrganizationSwitcher.test.tsx`:
- Around line 641-661: The test fails because the user fixture lacks
create_organization_enabled, so update the setup in the createFixtures callback
(the call to f.withUser) to include create_organization_enabled: true (e.g.,
f.withUser({ email_addresses: ['test@clerk.com'], create_organization_enabled:
true })) so the "Create organization" menu item is rendered; keep the rest of
the test that wraps OrganizationSwitcher with UNSAFE_PortalProvider
(getContainer) and asserts fixtures.clerk.openCreateOrganization was called with
expect.objectContaining({ getContainer }).
- Around line 619-639: The test fails because no organization_memberships are
set up, so the "Manage Organization" menu item never appears; update the fixture
setup inside the createFixtures callback (the function passed to createFixtures
and its fixture builder f) to include an organization membership for the user by
calling the fixture method that creates memberships (e.g.,
f.withOrganizationMemberships(...) or the project’s equivalent) after
f.withOrganizations() so the user is a member of the created organization and
the OrganizationSwitcher test can find and click "Manage Organization".
Description
The
<UNSAFE_PortalProvider>component allows you to specify a custom container for Clerk floating UI elements (popovers, modals, tooltips, etc.) that use portals. Only Clerk components within the provider will be affected, components outside the provider will continue to use the default document.body for portals.This is particularly useful when using Clerk components inside external UI libraries like Radix Dialog or React Aria Components, where portaled elements need to render within the dialog's container to remain interact-able.
Example usage
Docs: clerk/clerk-docs#2896
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
New Features
UI
Style
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.